import request from '@/utils/request'

// 查询广告列表
export function listAdvertisement(data) {
  return request({
    url: '/sys/advertisement/selectAll',
    method: 'post',
    data: data
  })
}

// 获取弹窗广告
export function getAdvertisementModal(data) {
  return request({
    url: '/app/advertisement/getAdvertisement',
    method: 'post',
    data: data
  })
}
// 查询广告详细
export function getAdvertisement(id) {
  return request({
    url: `/sys/advertisement/${id}`,
    method: 'get'
  })
}

// 新增广告
export function addAdvertisement(data) {
  return request({
    url: '/sys/advertisement/edit',
    method: 'post',
    data: data
  })
}

// 修改广告
export function updateAdvertisement(data) {
  return request({
    url: '/car/advertisement',
    method: 'put',
    data: data
  })
}

// 删除广告
export function delAdvertisement(data) {
  return request({
    url: '/sys/advertisement/delete',
    method: 'post',
    data:data
  })
}
// 立即弹窗
export function show(id) {
  return request({
    url: `/sys/advertisement/unpack/${id}`,
    method: 'get'
  })
}
